package cis;

import java.awt.CardLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Desktop;
import java.io.File;
import java.io.IOException;
import java.sql.ResultSet;
import java.util.Arrays;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.UIManager;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableColumn;
import javax.swing.table.TableColumnModel;
import javax.swing.table.TableModel;

//the entry point and the GUI of the application
public class CisMainWindow extends javax.swing.JFrame {

    //constructor
    public CisMainWindow() {
        //initialize visible controls
        initComponents();
        
        //display the Home view
        jToggleButtonHome.doClick();
        
        setExtendedState(JFrame.MAXIMIZED_BOTH);
        setVisible(true);
        
        getContentPane().setVisible(false);
        
        //login, change password
        loginAndChangePassword();
        
        //if login successful, create the required models and listeners
        createComboBoxModels();
        createTableModels();
        createTableSelectionChangedListeners();
        
        getContentPane().setVisible(true);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        java.awt.GridBagConstraints gridBagConstraints;

        jPanelLoginContainer = new javax.swing.JPanel();
        jPanelLoginContent = new javax.swing.JPanel();
        jLabelUsername = new javax.swing.JLabel();
        jLabelPassword = new javax.swing.JLabel();
        jTextFieldUsername = new javax.swing.JTextField();
        jPasswordFieldPassword = new javax.swing.JPasswordField();
        jPanelChangePasswordContainer = new javax.swing.JPanel();
        jPanelChangePasswordContent = new javax.swing.JPanel();
        jLabelOldPassword = new javax.swing.JLabel();
        jLabelNewPassword = new javax.swing.JLabel();
        jLabelConfirmPassword = new javax.swing.JLabel();
        jPasswordFieldOldPassword = new javax.swing.JPasswordField();
        jPasswordFieldNewPassword = new javax.swing.JPasswordField();
        jPasswordFieldConfirmPassword = new javax.swing.JPasswordField();
        buttonGroupToolbarButtons = new javax.swing.ButtonGroup();
        jToolBar = new javax.swing.JToolBar();
        jToggleButtonHome = new javax.swing.JToggleButton();
        jToggleButtonCampaigns = new javax.swing.JToggleButton();
        jToggleButtonProducts = new javax.swing.JToggleButton();
        jPanelMainContents = new javax.swing.JPanel();
        jPanelHome = new javax.swing.JPanel();
        jLabelBanner = new javax.swing.JLabel();
        jPanelInfoContent = new javax.swing.JPanel();
        jScrollPaneInfoContent = new javax.swing.JScrollPane();
        jLabelInfoContent = new javax.swing.JLabel();
        jPanelCampaigns = new javax.swing.JPanel();
        jTabbedPaneOneCampaign = new javax.swing.JTabbedPane();
        jPanelAddCampaignContainer = new javax.swing.JPanel();
        jPanelAddCampaignContent = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jComboBoxAddCampaignProductName = new javax.swing.JComboBox();
        jTextFieldAddCampaignType = new javax.swing.JTextField();
        jSpinnerAddCampaignPeriod = new javax.swing.JSpinner();
        jSpinnerAddCampaignActualBudget = new javax.swing.JSpinner();
        jSpinnerAddCampaignActualSales = new javax.swing.JSpinner();
        jSpinnerAddCampaignEstimatedBudget = new javax.swing.JSpinner();
        jSpinnerAddCampaignEstimatedSales = new javax.swing.JSpinner();
        jButtonAddCampaignAdd = new javax.swing.JButton();
        jPanelUpdateCampaignContainer = new javax.swing.JPanel();
        jPanelUpdateCampaignContent = new javax.swing.JPanel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jComboBoxUpdateCampaignProductName = new javax.swing.JComboBox();
        jTextFieldUpdateCampaignType = new javax.swing.JTextField();
        jSpinnerUpdateCampaignPeriod = new javax.swing.JSpinner();
        jSpinnerUpdateCampaignActualBudget = new javax.swing.JSpinner();
        jSpinnerUpdateCampaignActualSales = new javax.swing.JSpinner();
        jSpinnerUpdateCampaignEstimatedBudget = new javax.swing.JSpinner();
        jSpinnerUpdateCampaignEstimatedSales = new javax.swing.JSpinner();
        jButtonUpdateCampaignUpdate = new javax.swing.JButton();
        jPanelDeleteCampaignContainer = new javax.swing.JPanel();
        jPanelDeleteCampaignContent = new javax.swing.JPanel();
        jLabel16 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        jLabel20 = new javax.swing.JLabel();
        jLabel21 = new javax.swing.JLabel();
        jLabel22 = new javax.swing.JLabel();
        jComboBoxDeleteCampaignProductName = new javax.swing.JComboBox();
        jTextFieldDeleteCampaignType = new javax.swing.JTextField();
        jSpinnerDeleteCampaignPeriod = new javax.swing.JSpinner();
        jSpinnerDeleteCampaignActualBudget = new javax.swing.JSpinner();
        jSpinnerDeleteCampaignActualSales = new javax.swing.JSpinner();
        jSpinnerDeleteCampaignEstimatedBudget = new javax.swing.JSpinner();
        jSpinnerDeleteCampaignEstimatedSales = new javax.swing.JSpinner();
        jButtonDeleteCampaignDelete = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTableAllCampaigns = new javax.swing.JTable();
        jPanelProducts = new javax.swing.JPanel();
        jTabbedPaneOneProduct = new javax.swing.JTabbedPane();
        jPanelAddProductContainer = new javax.swing.JPanel();
        jPanelAddProductContent = new javax.swing.JPanel();
        jLabel11 = new javax.swing.JLabel();
        jLabel23 = new javax.swing.JLabel();
        jTextFieldAddProductProductName = new javax.swing.JTextField();
        jScrollPane3 = new javax.swing.JScrollPane();
        jTextAreaAddProductComment = new javax.swing.JTextArea();
        jButtonAddProductAdd = new javax.swing.JButton();
        jPanel9 = new javax.swing.JPanel();
        jPanel10 = new javax.swing.JPanel();
        jLabel24 = new javax.swing.JLabel();
        jLabel25 = new javax.swing.JLabel();
        jTextFieldUpdateProductProductName = new javax.swing.JTextField();
        jScrollPane4 = new javax.swing.JScrollPane();
        jTextAreaUpdateProductComment = new javax.swing.JTextArea();
        jButtonUpdateProductUpdate = new javax.swing.JButton();
        jPanel11 = new javax.swing.JPanel();
        jPanel12 = new javax.swing.JPanel();
        jLabel26 = new javax.swing.JLabel();
        jLabel27 = new javax.swing.JLabel();
        jTextFieldDeleteProductProductName = new javax.swing.JTextField();
        jScrollPane5 = new javax.swing.JScrollPane();
        jTextAreaDeleteProductComment = new javax.swing.JTextArea();
        jButtonDeleteProductDelete = new javax.swing.JButton();
        jScrollPane2 = new javax.swing.JScrollPane();
        jTableAllProducts = new javax.swing.JTable();
        jMenuBar = new javax.swing.JMenuBar();
        jMenuFile = new javax.swing.JMenu();
        jMenuItemExit = new javax.swing.JMenuItem();
        jMenuHelp = new javax.swing.JMenu();
        jMenuItemUserGuide = new javax.swing.JMenuItem();

        jPanelLoginContainer.setLayout(new java.awt.GridBagLayout());

        jPanelLoginContent.setLayout(new java.awt.GridBagLayout());

        jLabelUsername.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabelUsername.setForeground(new java.awt.Color(0, 0, 255));
        jLabelUsername.setText("Username");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 20);
        jPanelLoginContent.add(jLabelUsername, gridBagConstraints);

        jLabelPassword.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabelPassword.setForeground(new java.awt.Color(0, 0, 255));
        jLabelPassword.setText("Password");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        jPanelLoginContent.add(jLabelPassword, gridBagConstraints);

        jTextFieldUsername.setMinimumSize(new java.awt.Dimension(200, 20));
        jTextFieldUsername.setPreferredSize(new java.awt.Dimension(200, 20));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 0);
        jPanelLoginContent.add(jTextFieldUsername, gridBagConstraints);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 0);
        jPanelLoginContent.add(jPasswordFieldPassword, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.insets = new java.awt.Insets(20, 40, 20, 40);
        jPanelLoginContainer.add(jPanelLoginContent, gridBagConstraints);

        jPanelChangePasswordContainer.setLayout(new java.awt.GridBagLayout());

        jPanelChangePasswordContent.setLayout(new java.awt.GridBagLayout());

        jLabelOldPassword.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabelOldPassword.setForeground(new java.awt.Color(0, 0, 255));
        jLabelOldPassword.setText("Old Password");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        jPanelChangePasswordContent.add(jLabelOldPassword, gridBagConstraints);

        jLabelNewPassword.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabelNewPassword.setForeground(new java.awt.Color(0, 0, 255));
        jLabelNewPassword.setText("New Password");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        jPanelChangePasswordContent.add(jLabelNewPassword, gridBagConstraints);

        jLabelConfirmPassword.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabelConfirmPassword.setForeground(new java.awt.Color(0, 0, 255));
        jLabelConfirmPassword.setText("Confirm Password");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 10);
        jPanelChangePasswordContent.add(jLabelConfirmPassword, gridBagConstraints);

        jPasswordFieldOldPassword.setMinimumSize(new java.awt.Dimension(200, 20));
        jPasswordFieldOldPassword.setPreferredSize(new java.awt.Dimension(200, 20));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 0);
        jPanelChangePasswordContent.add(jPasswordFieldOldPassword, gridBagConstraints);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 0);
        jPanelChangePasswordContent.add(jPasswordFieldNewPassword, gridBagConstraints);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 0);
        jPanelChangePasswordContent.add(jPasswordFieldConfirmPassword, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.insets = new java.awt.Insets(20, 40, 20, 40);
        jPanelChangePasswordContainer.add(jPanelChangePasswordContent, gridBagConstraints);

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Campaign Information System");
        setExtendedState(1);

        jToolBar.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 1, true));
        jToolBar.setOrientation(1);
        jToolBar.setRollover(true);

        buttonGroupToolbarButtons.add(jToggleButtonHome);
        jToggleButtonHome.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Icons/Home.PNG"))); // NOI18N
        jToggleButtonHome.setToolTipText("Home");
        jToggleButtonHome.setFocusable(false);
        jToggleButtonHome.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jToggleButtonHome.setMaximumSize(new java.awt.Dimension(48, 48));
        jToggleButtonHome.setMinimumSize(new java.awt.Dimension(48, 48));
        jToggleButtonHome.setPreferredSize(new java.awt.Dimension(48, 48));
        jToggleButtonHome.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jToggleButtonHome.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jToggleButtonHomeItemStateChanged(evt);
            }
        });
        jToolBar.add(jToggleButtonHome);

        buttonGroupToolbarButtons.add(jToggleButtonCampaigns);
        jToggleButtonCampaigns.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Icons/Campaigns.png"))); // NOI18N
        jToggleButtonCampaigns.setToolTipText("Campaigns");
        jToggleButtonCampaigns.setFocusable(false);
        jToggleButtonCampaigns.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jToggleButtonCampaigns.setMaximumSize(new java.awt.Dimension(48, 48));
        jToggleButtonCampaigns.setMinimumSize(new java.awt.Dimension(48, 48));
        jToggleButtonCampaigns.setPreferredSize(new java.awt.Dimension(48, 48));
        jToggleButtonCampaigns.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jToggleButtonCampaigns.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jToggleButtonCampaignsItemStateChanged(evt);
            }
        });
        jToolBar.add(jToggleButtonCampaigns);

        buttonGroupToolbarButtons.add(jToggleButtonProducts);
        jToggleButtonProducts.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Icons/Products.PNG"))); // NOI18N
        jToggleButtonProducts.setToolTipText("Products");
        jToggleButtonProducts.setFocusable(false);
        jToggleButtonProducts.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jToggleButtonProducts.setMaximumSize(new java.awt.Dimension(48, 48));
        jToggleButtonProducts.setMinimumSize(new java.awt.Dimension(48, 48));
        jToggleButtonProducts.setPreferredSize(new java.awt.Dimension(48, 48));
        jToggleButtonProducts.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jToggleButtonProducts.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jToggleButtonProductsItemStateChanged(evt);
            }
        });
        jToolBar.add(jToggleButtonProducts);

        getContentPane().add(jToolBar, java.awt.BorderLayout.LINE_START);

        jPanelMainContents.setLayout(new java.awt.CardLayout());

        jPanelHome.setBackground(new java.awt.Color(154, 233, 251));
        jPanelHome.setEnabled(false);
        jPanelHome.setLayout(new java.awt.GridBagLayout());

        jLabelBanner.setBackground(new java.awt.Color(154, 233, 251));
        jLabelBanner.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelBanner.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Icons/banner.gif"))); // NOI18N
        jLabelBanner.setOpaque(true);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.weighty = 0.01;
        jPanelHome.add(jLabelBanner, gridBagConstraints);

        jPanelInfoContent.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jPanelInfoContent.setLayout(new java.awt.GridBagLayout());

        jScrollPaneInfoContent.setBorder(null);

        jLabelInfoContent.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelInfoContent.setText("<html>\n<center>\n        <br />\n        <h3><font color=\"#ff0000\">Campaign Management 1.0</font></h3>\n        <font color=\"#0000ff\"><p>© 2010 by Project Team</p></font><br /><br />\n        \n        <h3><font color=\"#ff0000\">Project Team</font></h3>\n        <font color=\"#0000ff\"><p>Ky Anh Huy</p><br />\n        <p>La Duc Phong</p><br />\n        <p>Phan Doan Quoc Thai</p></font><br /><br />\n        \n        <h3><font color=\"#ff0000\">Thanks To</font></h3>\n        <font color=\"#0000ff\"><p>Ong Thi My Linh</p></font><br /><br />\n        \n        <h3><font color=\"#ff0000\">Contact Us</font></h3>\n        <font color=\"#0000ff\"><p>Y!M: laducphong1990</p><br />\n        <p>ahuy2009@gmail.com</p><br />\n        <p>laducphong1990@yahoo.com</p><br />\n        <p>thaimagic99@yahoo.ca</p></font><br /><br />\n    </center>\n</html>");
        jLabelInfoContent.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        jScrollPaneInfoContent.setViewportView(jLabelInfoContent);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.weighty = 1.0;
        gridBagConstraints.insets = new java.awt.Insets(10, 0, 10, 0);
        jPanelInfoContent.add(jScrollPaneInfoContent, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.weighty = 1.0;
        gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
        jPanelHome.add(jPanelInfoContent, gridBagConstraints);

        jPanelMainContents.add(jPanelHome, "card2");

        jPanelCampaigns.setLayout(new java.awt.GridBagLayout());

        jTabbedPaneOneCampaign.setForeground(new java.awt.Color(255, 0, 0));
        jTabbedPaneOneCampaign.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N

        jPanelAddCampaignContainer.setLayout(new java.awt.GridBagLayout());

        jPanelAddCampaignContent.setLayout(new java.awt.GridBagLayout());

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel1.setForeground(new java.awt.Color(0, 0, 255));
        jLabel1.setText("Product Name");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        jPanelAddCampaignContent.add(jLabel1, gridBagConstraints);

        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel2.setForeground(new java.awt.Color(0, 0, 255));
        jLabel2.setText("Campaign Type");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        jPanelAddCampaignContent.add(jLabel2, gridBagConstraints);

        jLabel3.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel3.setForeground(new java.awt.Color(0, 0, 255));
        jLabel3.setText("Campaign Period");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        jPanelAddCampaignContent.add(jLabel3, gridBagConstraints);

        jLabel4.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel4.setForeground(new java.awt.Color(0, 0, 255));
        jLabel4.setText("Actual Budget");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        jPanelAddCampaignContent.add(jLabel4, gridBagConstraints);

        jLabel5.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel5.setForeground(new java.awt.Color(0, 0, 255));
        jLabel5.setText("Actual Sales");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 4;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        jPanelAddCampaignContent.add(jLabel5, gridBagConstraints);

        jLabel6.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel6.setForeground(new java.awt.Color(0, 0, 255));
        jLabel6.setText("Estimated Budget");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 5;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 20);
        jPanelAddCampaignContent.add(jLabel6, gridBagConstraints);

        jLabel7.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel7.setForeground(new java.awt.Color(0, 0, 255));
        jLabel7.setText("Estimated Sales");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 6;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        jPanelAddCampaignContent.add(jLabel7, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 0);
        jPanelAddCampaignContent.add(jComboBoxAddCampaignProductName, gridBagConstraints);

        jTextFieldAddCampaignType.setMinimumSize(new java.awt.Dimension(200, 20));
        jTextFieldAddCampaignType.setPreferredSize(new java.awt.Dimension(200, 20));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 0);
        jPanelAddCampaignContent.add(jTextFieldAddCampaignType, gridBagConstraints);

        jSpinnerAddCampaignPeriod.setModel(new javax.swing.SpinnerNumberModel(30, 1, 360, 30));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 0);
        jPanelAddCampaignContent.add(jSpinnerAddCampaignPeriod, gridBagConstraints);

        jSpinnerAddCampaignActualBudget.setModel(new javax.swing.SpinnerNumberModel(1000, 1, 999999999, 100));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 0);
        jPanelAddCampaignContent.add(jSpinnerAddCampaignActualBudget, gridBagConstraints);

        jSpinnerAddCampaignActualSales.setModel(new javax.swing.SpinnerNumberModel(1000, 1, 999999999, 100));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 4;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 0);
        jPanelAddCampaignContent.add(jSpinnerAddCampaignActualSales, gridBagConstraints);

        jSpinnerAddCampaignEstimatedBudget.setModel(new javax.swing.SpinnerNumberModel(1000, 1, 999999999, 100));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 5;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 0);
        jPanelAddCampaignContent.add(jSpinnerAddCampaignEstimatedBudget, gridBagConstraints);

        jSpinnerAddCampaignEstimatedSales.setModel(new javax.swing.SpinnerNumberModel(1000, 1, 999999999, 100));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 6;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 0);
        jPanelAddCampaignContent.add(jSpinnerAddCampaignEstimatedSales, gridBagConstraints);

        jButtonAddCampaignAdd.setFont(new java.awt.Font("Tahoma", 1, 14));
        jButtonAddCampaignAdd.setForeground(new java.awt.Color(255, 0, 0));
        jButtonAddCampaignAdd.setText("     Add     ");
        jButtonAddCampaignAdd.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonAddCampaignAddActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
        jPanelAddCampaignContent.add(jButtonAddCampaignAdd, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.insets = new java.awt.Insets(20, 20, 20, 20);
        jPanelAddCampaignContainer.add(jPanelAddCampaignContent, gridBagConstraints);

        jTabbedPaneOneCampaign.addTab("Add Campaign", jPanelAddCampaignContainer);

        jPanelUpdateCampaignContainer.setLayout(new java.awt.GridBagLayout());

        jPanelUpdateCampaignContent.setLayout(new java.awt.GridBagLayout());

        jLabel8.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel8.setForeground(new java.awt.Color(0, 0, 255));
        jLabel8.setText("Product Name");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        jPanelUpdateCampaignContent.add(jLabel8, gridBagConstraints);

        jLabel9.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel9.setForeground(new java.awt.Color(0, 0, 255));
        jLabel9.setText("Campaign Type");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        jPanelUpdateCampaignContent.add(jLabel9, gridBagConstraints);

        jLabel10.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel10.setForeground(new java.awt.Color(0, 0, 255));
        jLabel10.setText("Campaign Period");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        jPanelUpdateCampaignContent.add(jLabel10, gridBagConstraints);

        jLabel12.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel12.setForeground(new java.awt.Color(0, 0, 255));
        jLabel12.setText("Actual Budget");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        jPanelUpdateCampaignContent.add(jLabel12, gridBagConstraints);

        jLabel13.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel13.setForeground(new java.awt.Color(0, 0, 255));
        jLabel13.setText("Actual Sales");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 4;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        jPanelUpdateCampaignContent.add(jLabel13, gridBagConstraints);

        jLabel14.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel14.setForeground(new java.awt.Color(0, 0, 255));
        jLabel14.setText("Estimated Budget");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 5;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 20);
        jPanelUpdateCampaignContent.add(jLabel14, gridBagConstraints);

        jLabel15.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel15.setForeground(new java.awt.Color(0, 0, 255));
        jLabel15.setText("Estimated Sales");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 6;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        jPanelUpdateCampaignContent.add(jLabel15, gridBagConstraints);

        jComboBoxUpdateCampaignProductName.setEnabled(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 0);
        jPanelUpdateCampaignContent.add(jComboBoxUpdateCampaignProductName, gridBagConstraints);

        jTextFieldUpdateCampaignType.setEditable(false);
        jTextFieldUpdateCampaignType.setEnabled(false);
        jTextFieldUpdateCampaignType.setMinimumSize(new java.awt.Dimension(200, 20));
        jTextFieldUpdateCampaignType.setPreferredSize(new java.awt.Dimension(200, 20));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 0);
        jPanelUpdateCampaignContent.add(jTextFieldUpdateCampaignType, gridBagConstraints);

        jSpinnerUpdateCampaignPeriod.setModel(new javax.swing.SpinnerNumberModel(30, 1, 360, 30));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 0);
        jPanelUpdateCampaignContent.add(jSpinnerUpdateCampaignPeriod, gridBagConstraints);

        jSpinnerUpdateCampaignActualBudget.setModel(new javax.swing.SpinnerNumberModel(1000, 1, 999999999, 100));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 0);
        jPanelUpdateCampaignContent.add(jSpinnerUpdateCampaignActualBudget, gridBagConstraints);

        jSpinnerUpdateCampaignActualSales.setModel(new javax.swing.SpinnerNumberModel(1000, 1, 999999999, 100));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 4;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 0);
        jPanelUpdateCampaignContent.add(jSpinnerUpdateCampaignActualSales, gridBagConstraints);

        jSpinnerUpdateCampaignEstimatedBudget.setModel(new javax.swing.SpinnerNumberModel(1000, 1, 999999999, 100));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 5;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 0);
        jPanelUpdateCampaignContent.add(jSpinnerUpdateCampaignEstimatedBudget, gridBagConstraints);

        jSpinnerUpdateCampaignEstimatedSales.setModel(new javax.swing.SpinnerNumberModel(1000, 1, 999999999, 100));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 6;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 0);
        jPanelUpdateCampaignContent.add(jSpinnerUpdateCampaignEstimatedSales, gridBagConstraints);

        jButtonUpdateCampaignUpdate.setFont(new java.awt.Font("Tahoma", 1, 14));
        jButtonUpdateCampaignUpdate.setForeground(new java.awt.Color(255, 0, 0));
        jButtonUpdateCampaignUpdate.setText("Update");
        jButtonUpdateCampaignUpdate.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonUpdateCampaignUpdateActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
        jPanelUpdateCampaignContent.add(jButtonUpdateCampaignUpdate, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.insets = new java.awt.Insets(20, 20, 20, 20);
        jPanelUpdateCampaignContainer.add(jPanelUpdateCampaignContent, gridBagConstraints);

        jTabbedPaneOneCampaign.addTab("Update Campaign", jPanelUpdateCampaignContainer);

        jPanelDeleteCampaignContainer.setLayout(new java.awt.GridBagLayout());

        jPanelDeleteCampaignContent.setLayout(new java.awt.GridBagLayout());

        jLabel16.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel16.setForeground(new java.awt.Color(0, 0, 255));
        jLabel16.setText("Product Name");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        jPanelDeleteCampaignContent.add(jLabel16, gridBagConstraints);

        jLabel17.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel17.setForeground(new java.awt.Color(0, 0, 255));
        jLabel17.setText("Campaign Type");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        jPanelDeleteCampaignContent.add(jLabel17, gridBagConstraints);

        jLabel18.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel18.setForeground(new java.awt.Color(0, 0, 255));
        jLabel18.setText("Campaign Period");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        jPanelDeleteCampaignContent.add(jLabel18, gridBagConstraints);

        jLabel19.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel19.setForeground(new java.awt.Color(0, 0, 255));
        jLabel19.setText("Actual Budget");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        jPanelDeleteCampaignContent.add(jLabel19, gridBagConstraints);

        jLabel20.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel20.setForeground(new java.awt.Color(0, 0, 255));
        jLabel20.setText("Actual Sales");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 4;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        jPanelDeleteCampaignContent.add(jLabel20, gridBagConstraints);

        jLabel21.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel21.setForeground(new java.awt.Color(0, 0, 255));
        jLabel21.setText("Estimated Budget");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 5;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 20);
        jPanelDeleteCampaignContent.add(jLabel21, gridBagConstraints);

        jLabel22.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel22.setForeground(new java.awt.Color(0, 0, 255));
        jLabel22.setText("Estimated Sales");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 6;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        jPanelDeleteCampaignContent.add(jLabel22, gridBagConstraints);

        jComboBoxDeleteCampaignProductName.setEnabled(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 0);
        jPanelDeleteCampaignContent.add(jComboBoxDeleteCampaignProductName, gridBagConstraints);

        jTextFieldDeleteCampaignType.setEditable(false);
        jTextFieldDeleteCampaignType.setEnabled(false);
        jTextFieldDeleteCampaignType.setMinimumSize(new java.awt.Dimension(200, 20));
        jTextFieldDeleteCampaignType.setPreferredSize(new java.awt.Dimension(200, 20));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 0);
        jPanelDeleteCampaignContent.add(jTextFieldDeleteCampaignType, gridBagConstraints);

        jSpinnerDeleteCampaignPeriod.setModel(new javax.swing.SpinnerNumberModel(30, 1, 360, 30));
        jSpinnerDeleteCampaignPeriod.setEnabled(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 0);
        jPanelDeleteCampaignContent.add(jSpinnerDeleteCampaignPeriod, gridBagConstraints);

        jSpinnerDeleteCampaignActualBudget.setModel(new javax.swing.SpinnerNumberModel(1000, 1, 999999999, 100));
        jSpinnerDeleteCampaignActualBudget.setEnabled(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 0);
        jPanelDeleteCampaignContent.add(jSpinnerDeleteCampaignActualBudget, gridBagConstraints);

        jSpinnerDeleteCampaignActualSales.setModel(new javax.swing.SpinnerNumberModel(1000, 1, 999999999, 100));
        jSpinnerDeleteCampaignActualSales.setEnabled(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 4;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 0);
        jPanelDeleteCampaignContent.add(jSpinnerDeleteCampaignActualSales, gridBagConstraints);

        jSpinnerDeleteCampaignEstimatedBudget.setModel(new javax.swing.SpinnerNumberModel(1000, 1, 999999999, 100));
        jSpinnerDeleteCampaignEstimatedBudget.setEnabled(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 5;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 0);
        jPanelDeleteCampaignContent.add(jSpinnerDeleteCampaignEstimatedBudget, gridBagConstraints);

        jSpinnerDeleteCampaignEstimatedSales.setModel(new javax.swing.SpinnerNumberModel(1000, 1, 999999999, 100));
        jSpinnerDeleteCampaignEstimatedSales.setEnabled(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 6;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 0);
        jPanelDeleteCampaignContent.add(jSpinnerDeleteCampaignEstimatedSales, gridBagConstraints);

        jButtonDeleteCampaignDelete.setFont(new java.awt.Font("Tahoma", 1, 14));
        jButtonDeleteCampaignDelete.setForeground(new java.awt.Color(255, 0, 0));
        jButtonDeleteCampaignDelete.setText("Delete");
        jButtonDeleteCampaignDelete.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonDeleteCampaignDeleteActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
        jPanelDeleteCampaignContent.add(jButtonDeleteCampaignDelete, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.insets = new java.awt.Insets(20, 20, 20, 20);
        jPanelDeleteCampaignContainer.add(jPanelDeleteCampaignContent, gridBagConstraints);

        jTabbedPaneOneCampaign.addTab("Delete Campaign", jPanelDeleteCampaignContainer);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.weighty = 0.1;
        gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
        jPanelCampaigns.add(jTabbedPaneOneCampaign, gridBagConstraints);

        jTableAllCampaigns.setAutoCreateRowSorter(true);
        jTableAllCampaigns.setBackground(new java.awt.Color(204, 255, 255));
        jTableAllCampaigns.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {

            }
        ));
        jTableAllCampaigns.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        jScrollPane1.setViewportView(jTableAllCampaigns);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.weighty = 1.0;
        gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
        jPanelCampaigns.add(jScrollPane1, gridBagConstraints);

        jPanelMainContents.add(jPanelCampaigns, "card3");

        jPanelProducts.setLayout(new java.awt.GridBagLayout());

        jTabbedPaneOneProduct.setForeground(new java.awt.Color(255, 0, 0));
        jTabbedPaneOneProduct.setFont(new java.awt.Font("Times New Roman", 1, 18));

        jPanelAddProductContainer.setLayout(new java.awt.GridBagLayout());

        jPanelAddProductContent.setLayout(new java.awt.GridBagLayout());

        jLabel11.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel11.setForeground(new java.awt.Color(0, 0, 255));
        jLabel11.setText("Product Name");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 20);
        jPanelAddProductContent.add(jLabel11, gridBagConstraints);

        jLabel23.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel23.setForeground(new java.awt.Color(0, 0, 255));
        jLabel23.setText("Comment");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        jPanelAddProductContent.add(jLabel23, gridBagConstraints);

        jTextFieldAddProductProductName.setMinimumSize(new java.awt.Dimension(200, 20));
        jTextFieldAddProductProductName.setPreferredSize(new java.awt.Dimension(200, 20));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 0);
        jPanelAddProductContent.add(jTextFieldAddProductProductName, gridBagConstraints);

        jTextAreaAddProductComment.setColumns(20);
        jTextAreaAddProductComment.setLineWrap(true);
        jTextAreaAddProductComment.setRows(5);
        jTextAreaAddProductComment.setWrapStyleWord(true);
        jScrollPane3.setViewportView(jTextAreaAddProductComment);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 0);
        jPanelAddProductContent.add(jScrollPane3, gridBagConstraints);

        jButtonAddProductAdd.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jButtonAddProductAdd.setForeground(new java.awt.Color(255, 0, 0));
        jButtonAddProductAdd.setText("     Add     ");
        jButtonAddProductAdd.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonAddProductAddActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
        jPanelAddProductContent.add(jButtonAddProductAdd, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.insets = new java.awt.Insets(20, 20, 20, 20);
        jPanelAddProductContainer.add(jPanelAddProductContent, gridBagConstraints);

        jTabbedPaneOneProduct.addTab("Add Product", jPanelAddProductContainer);

        jPanel9.setLayout(new java.awt.GridBagLayout());

        jPanel10.setLayout(new java.awt.GridBagLayout());

        jLabel24.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel24.setForeground(new java.awt.Color(0, 0, 255));
        jLabel24.setText("Product Name");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 20);
        jPanel10.add(jLabel24, gridBagConstraints);

        jLabel25.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel25.setForeground(new java.awt.Color(0, 0, 255));
        jLabel25.setText("Comment");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        jPanel10.add(jLabel25, gridBagConstraints);

        jTextFieldUpdateProductProductName.setEditable(false);
        jTextFieldUpdateProductProductName.setEnabled(false);
        jTextFieldUpdateProductProductName.setMinimumSize(new java.awt.Dimension(200, 20));
        jTextFieldUpdateProductProductName.setPreferredSize(new java.awt.Dimension(200, 20));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 0);
        jPanel10.add(jTextFieldUpdateProductProductName, gridBagConstraints);

        jTextAreaUpdateProductComment.setColumns(20);
        jTextAreaUpdateProductComment.setLineWrap(true);
        jTextAreaUpdateProductComment.setRows(5);
        jTextAreaUpdateProductComment.setWrapStyleWord(true);
        jScrollPane4.setViewportView(jTextAreaUpdateProductComment);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 0);
        jPanel10.add(jScrollPane4, gridBagConstraints);

        jButtonUpdateProductUpdate.setFont(new java.awt.Font("Tahoma", 1, 14));
        jButtonUpdateProductUpdate.setForeground(new java.awt.Color(255, 0, 0));
        jButtonUpdateProductUpdate.setText("Update");
        jButtonUpdateProductUpdate.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonUpdateProductUpdateActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
        jPanel10.add(jButtonUpdateProductUpdate, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.insets = new java.awt.Insets(20, 20, 20, 20);
        jPanel9.add(jPanel10, gridBagConstraints);

        jTabbedPaneOneProduct.addTab("Update Product", jPanel9);

        jPanel11.setLayout(new java.awt.GridBagLayout());

        jPanel12.setLayout(new java.awt.GridBagLayout());

        jLabel26.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel26.setForeground(new java.awt.Color(0, 0, 255));
        jLabel26.setText("Product Name");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 20);
        jPanel12.add(jLabel26, gridBagConstraints);

        jLabel27.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel27.setForeground(new java.awt.Color(0, 0, 255));
        jLabel27.setText("Comment");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        jPanel12.add(jLabel27, gridBagConstraints);

        jTextFieldDeleteProductProductName.setEditable(false);
        jTextFieldDeleteProductProductName.setEnabled(false);
        jTextFieldDeleteProductProductName.setMinimumSize(new java.awt.Dimension(200, 20));
        jTextFieldDeleteProductProductName.setPreferredSize(new java.awt.Dimension(200, 20));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 0);
        jPanel12.add(jTextFieldDeleteProductProductName, gridBagConstraints);

        jTextAreaDeleteProductComment.setColumns(20);
        jTextAreaDeleteProductComment.setEditable(false);
        jTextAreaDeleteProductComment.setLineWrap(true);
        jTextAreaDeleteProductComment.setRows(5);
        jTextAreaDeleteProductComment.setWrapStyleWord(true);
        jTextAreaDeleteProductComment.setEnabled(false);
        jScrollPane5.setViewportView(jTextAreaDeleteProductComment);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 0);
        jPanel12.add(jScrollPane5, gridBagConstraints);

        jButtonDeleteProductDelete.setFont(new java.awt.Font("Tahoma", 1, 14));
        jButtonDeleteProductDelete.setForeground(new java.awt.Color(255, 0, 0));
        jButtonDeleteProductDelete.setText("Delete");
        jButtonDeleteProductDelete.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonDeleteProductDeleteActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
        jPanel12.add(jButtonDeleteProductDelete, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.insets = new java.awt.Insets(20, 20, 20, 20);
        jPanel11.add(jPanel12, gridBagConstraints);

        jTabbedPaneOneProduct.addTab("Delete Product", jPanel11);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.weighty = 0.1;
        gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
        jPanelProducts.add(jTabbedPaneOneProduct, gridBagConstraints);

        jTableAllProducts.setAutoCreateRowSorter(true);
        jTableAllProducts.setBackground(new java.awt.Color(204, 255, 255));
        jTableAllProducts.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {

            }
        ));
        jTableAllProducts.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        jScrollPane2.setViewportView(jTableAllProducts);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.weighty = 1.0;
        gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
        jPanelProducts.add(jScrollPane2, gridBagConstraints);

        jPanelMainContents.add(jPanelProducts, "card4");

        getContentPane().add(jPanelMainContents, java.awt.BorderLayout.CENTER);

        jMenuFile.setMnemonic('F');
        jMenuFile.setText("File");

        jMenuItemExit.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F4, java.awt.event.InputEvent.ALT_MASK));
        jMenuItemExit.setMnemonic('x');
        jMenuItemExit.setText("Exit");
        jMenuItemExit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemExitActionPerformed(evt);
            }
        });
        jMenuFile.add(jMenuItemExit);

        jMenuBar.add(jMenuFile);

        jMenuHelp.setMnemonic('H');
        jMenuHelp.setText("Help");

        jMenuItemUserGuide.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F1, 0));
        jMenuItemUserGuide.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Icons/Help.PNG"))); // NOI18N
        jMenuItemUserGuide.setText("User Guide");
        jMenuItemUserGuide.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemUserGuideActionPerformed(evt);
            }
        });
        jMenuHelp.add(jMenuItemUserGuide);

        jMenuBar.add(jMenuHelp);

        setJMenuBar(jMenuBar);

        pack();
    }// </editor-fold>//GEN-END:initComponents

//check the role of the login user
//if username and password correct, return the user role
//otherwise return null
private String checkUserRole() {
    String role = null;
    
    //check if data is valid
    if (jTextFieldUsername.getText().length() == 0)
        JOptionPane.showMessageDialog(this, "Username cannot be empty", "Error", JOptionPane.ERROR_MESSAGE);
    else if (!jTextFieldUsername.getText().matches("[\\w]+"))
        JOptionPane.showMessageDialog(this, "Username can only contains:\n- a-z\n- A-Z\n- 0-9\n- _", "Error", JOptionPane.ERROR_MESSAGE);
    else if (jPasswordFieldPassword.getPassword().length == 0)
        JOptionPane.showMessageDialog(this, "Password cannot be empty", "Error", JOptionPane.ERROR_MESSAGE);
    else {
        try {
            //get user information from database
            ResultSet account = CisDatabase.getAccount(jTextFieldUsername.getText());
            
            //if user and password correct, return the role
            if (CisDatabase.getResulSetRowCount(account) == 0)
                JOptionPane.showMessageDialog(this, "User does not exist", "Error", JOptionPane.ERROR_MESSAGE);
            else {
                account.first();
                char[] inputPassword = jPasswordFieldPassword.getPassword();
                char[] correctPassword = account.getString(2).toCharArray();
                if (!Arrays.equals(inputPassword, correctPassword))
                    JOptionPane.showMessageDialog(this, "Password is not correct", "Error", JOptionPane.ERROR_MESSAGE);
                else
                    role = account.getString(3);
                Arrays.fill(inputPassword, '0');
                Arrays.fill(correctPassword,'0');
            }
            
            account.close();
        }
        catch (Exception ex) {
            JOptionPane.showMessageDialog(this, ex.toString(), "Error", JOptionPane.ERROR_MESSAGE);
        }
    }
    
    return role;
}

//check if data is valid for changing password
private boolean checkPasswordCorrect() {
    if (jPasswordFieldOldPassword.getPassword().length == 0)
        JOptionPane.showMessageDialog(this, "Old password cannot be empty", "Error", JOptionPane.ERROR_MESSAGE);
    else if (!Arrays.equals(jPasswordFieldOldPassword.getPassword(), jPasswordFieldPassword.getPassword()))
        JOptionPane.showMessageDialog(this, "Old Password is not correct", "Error", JOptionPane.ERROR_MESSAGE);
    else if (jPasswordFieldNewPassword.getPassword().length == 0)
        JOptionPane.showMessageDialog(this, "New password cannot be empty", "Error", JOptionPane.ERROR_MESSAGE);
    else if (jPasswordFieldConfirmPassword.getPassword().length == 0)
        JOptionPane.showMessageDialog(this, "Confirmation password cannot be empty", "Error", JOptionPane.ERROR_MESSAGE);
    else if (!Arrays.equals(jPasswordFieldNewPassword.getPassword(), jPasswordFieldConfirmPassword.getPassword()))
        JOptionPane.showMessageDialog(this, "New and Confirmation passwords do not match", "Error", JOptionPane.ERROR_MESSAGE);
    else
        return true;

    return false;
}

//save the new password
private void updatePassword() {
    try {
        CisDatabase.updateAccount(jTextFieldUsername.getText(), String.valueOf(jPasswordFieldNewPassword.getPassword()));
    }
    catch (Exception ex) {
        JOptionPane.showMessageDialog(this, ex.toString(), "Error", JOptionPane.ERROR_MESSAGE);
    }
}

//login and change password
private void loginAndChangePassword() {
    
    while (true) {
        //show the login dialog
        int loginResult = JOptionPane.showOptionDialog(this, jPanelLoginContainer, "Login", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE, null, new String[]{"Login","Change Password","Exit"}, "Login");
        
        //if select Exit, close the application
        //if select Login, return successfully
        //if select Change Password, jump to the next block
        if (loginResult == JOptionPane.CANCEL_OPTION || loginResult == JOptionPane.CLOSED_OPTION)
            System.exit(0);
        else {
            String role = checkUserRole();
            if (role == null)
                continue;
            else {
                if (role.equalsIgnoreCase("User"))
                    //hide administration modules for normal user
                    hideAdministrationModules();
                if (loginResult == JOptionPane.OK_OPTION)
                    return;
                else
                    break;
            }
        }
    }
    
    while (true) {
        //show the Change Password dialog
        int changePasswordResult = JOptionPane.showOptionDialog(this, jPanelChangePasswordContainer, "Change Password", JOptionPane.YES_NO_OPTION, JOptionPane.PLAIN_MESSAGE, null, new String[]{"     Change     ","Cancel"}, "     Change     ");
        
        //if select Cancel, return successfully
        //if select Change, save the new password
        if (changePasswordResult == JOptionPane.NO_OPTION || changePasswordResult == JOptionPane.CLOSED_OPTION)
            return;
        else if (!checkPasswordCorrect())
            continue;
        else {
            updatePassword();
            break;
        }
    }
}

//hide administration modules for normal user
private void hideAdministrationModules() {
    jTabbedPaneOneCampaign.setVisible(false);
    jTabbedPaneOneProduct.setVisible(false);
    this.invalidate();
}

//create models for the campaign and product tables
private void createTableModels() {
    try {
        jTableAllProducts.setModel(new CisProductTableModel());
        jTableAllCampaigns.setModel(new CisCampaignTableModel());
    } catch (Exception ex) {
        JOptionPane.showMessageDialog(this, ex.toString(), "Error", JOptionPane.ERROR_MESSAGE);
    }
    
    //create renderer for two columns Budget Variance, Sales Variance
    createCampaignsTableRenderer();
    //change the column width properly
    TableColumn column = jTableAllProducts.getColumnModel().getColumn(0);
    column.setPreferredWidth(90);
    column = jTableAllProducts.getColumnModel().getColumn(1);
    column.setPreferredWidth(300);
    column = jTableAllProducts.getColumnModel().getColumn(2);
    column.setPreferredWidth(500);
}

//create renderer for two columns Budget Variance, Sales Variance
private void createCampaignsTableRenderer() {
    TableColumnModel columnModel = jTableAllCampaigns.getColumnModel();
    for (int i = 0; i < columnModel.getColumnCount(); i++) {
        
        TableColumn column = columnModel.getColumn(i);
        //for each of the two Variance column
        if (column.getHeaderValue().toString().contains("Variance")) {
            
            //create the custom renderer for the column
            column.setCellRenderer(new TableCellRenderer() {
                public Component getTableCellRendererComponent(
                        JTable table, Object value,
                        boolean isSelected, boolean hasFocus,
                        int row, int column) {

                    //the renderer is a label
                    JLabel label = new JLabel(value.toString());
                    if (table.getColumnModel().getColumn(column).getHeaderValue().toString().contains("Budget"))
                        //color of the Budget Variance column
                        label.setForeground(Integer.valueOf(value.toString())>100 ? Color.RED : Color.BLUE);
                    else
                        //color of the Sales Variance column
                        label.setForeground(Integer.valueOf(value.toString())<100 ? Color.RED : Color.BLUE);
                    
                    label.setOpaque(true);
                    label.setBackground(isSelected ? table.getSelectionBackground() : table.getBackground());
                    label.setHorizontalAlignment(JLabel.RIGHT);
                    
                    return label;
                }
            });
        }
    }
}

//create listener for selection changed events on the campaign and product tables
//to update the fields properly
private void createTableSelectionChangedListeners() {
    
    //create listener for the product table
    jTableAllProducts.getSelectionModel().addListSelectionListener(
            new ListSelectionListener() {
                public void valueChanged(ListSelectionEvent e) {
                    int selectedIndex = jTableAllProducts.getSelectedRow();
                    if (selectedIndex == -1) {
                        jTextFieldUpdateProductProductName.setText("");
                        jTextFieldDeleteProductProductName.setText("");
                        jTextAreaUpdateProductComment.setText("");
                        jTextAreaDeleteProductComment.setText("");
                    }
                    else {
                        int modelSelectedIndex = jTableAllProducts.convertRowIndexToModel(selectedIndex);
                        TableModel productTableModel = jTableAllProducts.getModel();
                        jTextFieldUpdateProductProductName.setText(
                                productTableModel.getValueAt(modelSelectedIndex, 1).toString());
                        jTextFieldDeleteProductProductName.setText(
                                productTableModel.getValueAt(modelSelectedIndex, 1).toString());
                        jTextAreaUpdateProductComment.setText(
                                productTableModel.getValueAt(modelSelectedIndex, 2).toString());
                        jTextAreaDeleteProductComment.setText(
                                productTableModel.getValueAt(modelSelectedIndex, 2).toString());
                    }
                }
            }
    );
    
    //create listener for the campaign table
    jTableAllCampaigns.getSelectionModel().addListSelectionListener(
            new ListSelectionListener() {
                public void valueChanged(ListSelectionEvent e) {
                    int selectedIndex = jTableAllCampaigns.getSelectedRow();
                    if (selectedIndex == -1) {
                        jComboBoxUpdateCampaignProductName.setSelectedIndex(0);
                        jComboBoxDeleteCampaignProductName.setSelectedIndex(0);
                        jTextFieldUpdateCampaignType.setText("");
                        jTextFieldDeleteCampaignType.setText("");
                        jSpinnerUpdateCampaignPeriod.setValue(new Integer(30));
                        jSpinnerDeleteCampaignPeriod.setValue(new Integer(30));
                        jSpinnerUpdateCampaignActualBudget.setValue(new Integer(1000));
                        jSpinnerDeleteCampaignActualBudget.setValue(new Integer(1000));
                        jSpinnerUpdateCampaignActualSales.setValue(new Integer(1000));
                        jSpinnerDeleteCampaignActualSales.setValue(new Integer(1000));
                        jSpinnerUpdateCampaignEstimatedBudget.setValue(new Integer(1000));
                        jSpinnerDeleteCampaignEstimatedBudget.setValue(new Integer(1000));
                        jSpinnerUpdateCampaignEstimatedSales.setValue(new Integer(1000));
                        jSpinnerDeleteCampaignEstimatedSales.setValue(new Integer(1000));
                    }
                    else {
                        int modelSelectedIndex = jTableAllCampaigns.convertRowIndexToModel(selectedIndex);
                        TableModel campaignTableModel = jTableAllCampaigns.getModel();
                        jComboBoxUpdateCampaignProductName.setSelectedItem(
                                campaignTableModel.getValueAt(modelSelectedIndex, 1));
                        jComboBoxDeleteCampaignProductName.setSelectedItem(
                                campaignTableModel.getValueAt(modelSelectedIndex, 1));
                        jTextFieldUpdateCampaignType.setText(
                                campaignTableModel.getValueAt(modelSelectedIndex, 2).toString());
                        jTextFieldDeleteCampaignType.setText(
                                campaignTableModel.getValueAt(modelSelectedIndex, 2).toString());
                        jSpinnerUpdateCampaignPeriod.setValue(
                                campaignTableModel.getValueAt(modelSelectedIndex, 3));
                        jSpinnerDeleteCampaignPeriod.setValue(
                                campaignTableModel.getValueAt(modelSelectedIndex, 3));
                        jSpinnerUpdateCampaignActualBudget.setValue(
                                campaignTableModel.getValueAt(modelSelectedIndex, 4));
                        jSpinnerDeleteCampaignActualBudget.setValue(
                                campaignTableModel.getValueAt(modelSelectedIndex, 4));
                        jSpinnerUpdateCampaignActualSales.setValue(
                                campaignTableModel.getValueAt(modelSelectedIndex, 5));
                        jSpinnerDeleteCampaignActualSales.setValue(
                                campaignTableModel.getValueAt(modelSelectedIndex, 5));
                        jSpinnerUpdateCampaignEstimatedBudget.setValue(
                                campaignTableModel.getValueAt(modelSelectedIndex, 6));
                        jSpinnerDeleteCampaignEstimatedBudget.setValue(
                                campaignTableModel.getValueAt(modelSelectedIndex, 6));
                        jSpinnerUpdateCampaignEstimatedSales.setValue(
                                campaignTableModel.getValueAt(modelSelectedIndex, 7));
                        jSpinnerDeleteCampaignEstimatedSales.setValue(
                                campaignTableModel.getValueAt(modelSelectedIndex, 7));
                    }
                }
            }
    );
}

//create models for 3 product name combo boxes
private void createComboBoxModels() {
    jComboBoxAddCampaignProductName.setModel(new CisProductNameComboBoxModel(
            jTableAllProducts));
    
    jComboBoxUpdateCampaignProductName.setModel(new CisProductNameComboBoxModel(
            jTableAllProducts));
    
    jComboBoxDeleteCampaignProductName.setModel(new CisProductNameComboBoxModel(
            jTableAllProducts));
    
    jComboBoxAddCampaignProductName.setSelectedIndex(0);
    jComboBoxUpdateCampaignProductName.setSelectedIndex(0);
    jComboBoxDeleteCampaignProductName.setSelectedIndex(0);
    
}

// Exit the application
private void jMenuItemExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemExitActionPerformed
    System.exit(0);
}//GEN-LAST:event_jMenuItemExitActionPerformed

// Open User Guide in the default pdf reader
private void jMenuItemUserGuideActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemUserGuideActionPerformed
    if (Desktop.isDesktopSupported()) {
        Desktop desktop = Desktop.getDesktop();
        try {
            desktop.open(new File("CIS_User_Guide.pdf"));
        } catch (IOException ex) {}
    }
}//GEN-LAST:event_jMenuItemUserGuideActionPerformed

//handle button Home clicked event
private void jToggleButtonHomeItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jToggleButtonHomeItemStateChanged
    toolbarButtonsItemStateChanged(evt);
}//GEN-LAST:event_jToggleButtonHomeItemStateChanged

//handle button Campaigns clicked event
private void jToggleButtonCampaignsItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jToggleButtonCampaignsItemStateChanged
    toolbarButtonsItemStateChanged(evt);
}//GEN-LAST:event_jToggleButtonCampaignsItemStateChanged

//handle button Products clicked event
private void jToggleButtonProductsItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jToggleButtonProductsItemStateChanged
    toolbarButtonsItemStateChanged(evt);
}//GEN-LAST:event_jToggleButtonProductsItemStateChanged

//handle 3 toolbar buttons clicked events
//switch to the appropriate view
private void toolbarButtonsItemStateChanged(java.awt.event.ItemEvent evt) {
    CardLayout layout = (CardLayout)(jPanelMainContents.getLayout());
    
    if (evt.getItemSelectable().equals(jToggleButtonHome))
        layout.show(jPanelMainContents, "card2");
    else if (evt.getItemSelectable().equals(jToggleButtonCampaigns))
        layout.show(jPanelMainContents, "card3");
    else
        layout.show(jPanelMainContents, "card4");
}

//add a campaign
private void jButtonAddCampaignAddActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAddCampaignAddActionPerformed
    String type = jTextFieldAddCampaignType.getText();
    
    if (jComboBoxAddCampaignProductName.getSelectedIndex() < 1)
        JOptionPane.showMessageDialog(this, "You have to select a product", "Error", JOptionPane.ERROR_MESSAGE);
    else if (type.length() == 0)
        JOptionPane.showMessageDialog(this, "Campaign type cannot be empty", "Error", JOptionPane.ERROR_MESSAGE);
    else {
        CisCampaignTableModel campaignTableModel = (CisCampaignTableModel)(jTableAllCampaigns.getModel());
        boolean foundCampaign = false;
        for (int i = 0; i < campaignTableModel.getRowCount(); i++)
            if (jComboBoxAddCampaignProductName.getSelectedItem().equals(campaignTableModel.getValueAt(i, 1)) && 
                    type.equalsIgnoreCase(campaignTableModel.getValueAt(i, 2).toString())) {
                foundCampaign = true;
                break;
            }
        
        if (foundCampaign)
            JOptionPane.showMessageDialog(this, "This campaign has already been added", "Error", JOptionPane.ERROR_MESSAGE);
        else {
            try {
                CisDatabase.addCampaign(CisCampaignTableModel.data, 
                        CisDatabase.getProductIdByName(CisProductTableModel.data, jComboBoxAddCampaignProductName.getSelectedItem().toString()), 
                        type, 
                        (Integer)(jSpinnerAddCampaignPeriod.getValue()), 
                        (Integer)(jSpinnerAddCampaignActualBudget.getValue()), 
                        (Integer)(jSpinnerAddCampaignActualSales.getValue()), 
                        (Integer)(jSpinnerAddCampaignEstimatedBudget.getValue()), 
                        (Integer)(jSpinnerAddCampaignEstimatedSales.getValue()));
                campaignTableModel.fireRowsInsertedEvent();
            }
            catch (Exception ex) {
                JOptionPane.showMessageDialog(this, "Cannot add the campaign to database: " + ex, "Error", JOptionPane.ERROR_MESSAGE);
            }
        }
    }
}//GEN-LAST:event_jButtonAddCampaignAddActionPerformed

//update a campaign
private void jButtonUpdateCampaignUpdateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonUpdateCampaignUpdateActionPerformed
    if (jTableAllCampaigns.getSelectedRow() == -1)
        JOptionPane.showMessageDialog(this, "You have to select a campaign to update", "Update Campaign", JOptionPane.INFORMATION_MESSAGE);
    else
        try {
            int modelSelectedIndex = jTableAllCampaigns.convertRowIndexToModel(jTableAllCampaigns.getSelectedRow());
            CisDatabase.updateCampaign(CisCampaignTableModel.data, 
                    modelSelectedIndex + 1, 
                    (Integer)(jSpinnerUpdateCampaignPeriod.getValue()), 
                    (Integer)(jSpinnerUpdateCampaignActualBudget.getValue()), 
                    (Integer)(jSpinnerUpdateCampaignActualSales.getValue()), 
                    (Integer)(jSpinnerUpdateCampaignEstimatedBudget.getValue()), 
                    (Integer)(jSpinnerUpdateCampaignEstimatedSales.getValue()));
            ((CisCampaignTableModel)jTableAllCampaigns.getModel()).fireRowsUpdatedEvent();
        }
        catch (Exception ex) {
            JOptionPane.showMessageDialog(this, "Cannot update the campaign to database: " + ex, "Error", JOptionPane.ERROR_MESSAGE);
        }
}//GEN-LAST:event_jButtonUpdateCampaignUpdateActionPerformed

//delete a campaign
private void jButtonDeleteCampaignDeleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonDeleteCampaignDeleteActionPerformed
    if (jTableAllCampaigns.getSelectedRow() == -1)
        JOptionPane.showMessageDialog(this, "You have to select a campaign to delete", "Delete Campaign", JOptionPane.INFORMATION_MESSAGE);
    else {
        int result = JOptionPane.showConfirmDialog(this, "Are you sure you want to delete this campaign?", "Confirm Deletion", JOptionPane.YES_NO_OPTION);
        if (result == JOptionPane.YES_OPTION)
            try {
                int modelSelectedIndex = jTableAllCampaigns.convertRowIndexToModel(jTableAllCampaigns.getSelectedRow());
                CisDatabase.deleteCampaign(CisCampaignTableModel.data, modelSelectedIndex + 1);
                ((CisCampaignTableModel)jTableAllCampaigns.getModel()).fireRowsDeletedEvent();
            }
            catch (Exception ex) {
                JOptionPane.showMessageDialog(this, "Cannot delete the campaign from database: " + ex, "Error", JOptionPane.ERROR_MESSAGE);
            }
    }
}//GEN-LAST:event_jButtonDeleteCampaignDeleteActionPerformed

//add a product
private void jButtonAddProductAddActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAddProductAddActionPerformed
    String productName = jTextFieldAddProductProductName.getText();
    
    if (productName.length() == 0)
        JOptionPane.showMessageDialog(this, "Product name cannot be empty", "Error", JOptionPane.ERROR_MESSAGE);
    else if (!productName.matches("[\\w, ]+"))
        JOptionPane.showMessageDialog(this, "Product name can only contains:\n- a-z\n- A-Z\n- 0-9\n- _\n- Space", "Error", JOptionPane.ERROR_MESSAGE);
    else {
        CisProductTableModel productTableModel = (CisProductTableModel)jTableAllProducts.getModel();
        boolean foundProduct = false;
        for (int i = 0; i < productTableModel.getRowCount(); i++)
            if (productTableModel.getValueAt(i, 1).toString().equalsIgnoreCase(productName)) {
                foundProduct = true;
                break;
            }
        
        if (foundProduct)
            JOptionPane.showMessageDialog(this, "This product has already been added", "Error", JOptionPane.ERROR_MESSAGE);
        else {
            try {
                CisDatabase.addProduct(CisProductTableModel.data, productName, jTextAreaAddProductComment.getText());
                productTableModel.fireRowsInsertedEvent();
                ((CisProductNameComboBoxModel)(jComboBoxAddCampaignProductName.getModel())).fireIntervalAddedEvent();
            }
            catch (Exception ex) {
                JOptionPane.showMessageDialog(this, "Cannot add the product to database: " + ex, "Error", JOptionPane.ERROR_MESSAGE);
            }
        }
    }
}//GEN-LAST:event_jButtonAddProductAddActionPerformed

//update a product
private void jButtonUpdateProductUpdateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonUpdateProductUpdateActionPerformed
    if (jTableAllProducts.getSelectedRow() == -1)
        JOptionPane.showMessageDialog(this, "You have to select a product to update", "Update Product", JOptionPane.INFORMATION_MESSAGE);
    else
        try {
            int modelSelectedIndex = jTableAllProducts.convertRowIndexToModel(jTableAllProducts.getSelectedRow());
            CisDatabase.updateProduct(CisProductTableModel.data, modelSelectedIndex + 1, jTextAreaUpdateProductComment.getText());
            ((CisProductTableModel)jTableAllProducts.getModel()).fireRowsUpdatedEvent();
        }
        catch (Exception ex) {
            JOptionPane.showMessageDialog(this, "Cannot update the product to database: " + ex, "Error", JOptionPane.ERROR_MESSAGE);
        }
}//GEN-LAST:event_jButtonUpdateProductUpdateActionPerformed

//delete a product
private void jButtonDeleteProductDeleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonDeleteProductDeleteActionPerformed
    if (jTableAllProducts.getSelectedRow() == -1)
        JOptionPane.showMessageDialog(this, "You have to select a product to delete", "Delete Product", JOptionPane.INFORMATION_MESSAGE);
    else {
        int result = JOptionPane.showConfirmDialog(this, "Are you sure you want to delete this product and all associated campaigns?", "Confirm Deletion", JOptionPane.YES_NO_OPTION);
        if (result == JOptionPane.YES_OPTION)
            try {
                int modelSelectedIndex = jTableAllProducts.convertRowIndexToModel(jTableAllProducts.getSelectedRow());
                CisDatabase.deleteProduct(CisProductTableModel.data, modelSelectedIndex + 1);
                ((CisProductTableModel)jTableAllProducts.getModel()).fireRowsDeletedEvent();
                ((CisCampaignTableModel)jTableAllCampaigns.getModel()).fireRowsDeletedEvent();
                ((CisProductNameComboBoxModel)(jComboBoxAddCampaignProductName.getModel())).fireIntervalRemovedEvent();
            }
            catch (Exception ex) {
                JOptionPane.showMessageDialog(this, "Cannot delete the product from database: " + ex, "Error", JOptionPane.ERROR_MESSAGE);
                ex.printStackTrace();
            }
    }
}//GEN-LAST:event_jButtonDeleteProductDeleteActionPerformed

    //the entry poitn method of the application
    public static void main(String args[]) {
        try {
	    // Set the system look and feel
            UIManager.setLookAndFeel(
                UIManager.getSystemLookAndFeelClassName());
        } 
        catch (Exception e) {
        }
        
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new CisMainWindow().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup buttonGroupToolbarButtons;
    private javax.swing.JButton jButtonAddCampaignAdd;
    private javax.swing.JButton jButtonAddProductAdd;
    private javax.swing.JButton jButtonDeleteCampaignDelete;
    private javax.swing.JButton jButtonDeleteProductDelete;
    private javax.swing.JButton jButtonUpdateCampaignUpdate;
    private javax.swing.JButton jButtonUpdateProductUpdate;
    private javax.swing.JComboBox jComboBoxAddCampaignProductName;
    private javax.swing.JComboBox jComboBoxDeleteCampaignProductName;
    private javax.swing.JComboBox jComboBoxUpdateCampaignProductName;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JLabel jLabelBanner;
    private javax.swing.JLabel jLabelConfirmPassword;
    private javax.swing.JLabel jLabelInfoContent;
    private javax.swing.JLabel jLabelNewPassword;
    private javax.swing.JLabel jLabelOldPassword;
    private javax.swing.JLabel jLabelPassword;
    private javax.swing.JLabel jLabelUsername;
    private javax.swing.JMenuBar jMenuBar;
    private javax.swing.JMenu jMenuFile;
    private javax.swing.JMenu jMenuHelp;
    private javax.swing.JMenuItem jMenuItemExit;
    private javax.swing.JMenuItem jMenuItemUserGuide;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel12;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JPanel jPanelAddCampaignContainer;
    private javax.swing.JPanel jPanelAddCampaignContent;
    private javax.swing.JPanel jPanelAddProductContainer;
    private javax.swing.JPanel jPanelAddProductContent;
    private javax.swing.JPanel jPanelCampaigns;
    private javax.swing.JPanel jPanelChangePasswordContainer;
    private javax.swing.JPanel jPanelChangePasswordContent;
    private javax.swing.JPanel jPanelDeleteCampaignContainer;
    private javax.swing.JPanel jPanelDeleteCampaignContent;
    private javax.swing.JPanel jPanelHome;
    private javax.swing.JPanel jPanelInfoContent;
    private javax.swing.JPanel jPanelLoginContainer;
    private javax.swing.JPanel jPanelLoginContent;
    private javax.swing.JPanel jPanelMainContents;
    private javax.swing.JPanel jPanelProducts;
    private javax.swing.JPanel jPanelUpdateCampaignContainer;
    private javax.swing.JPanel jPanelUpdateCampaignContent;
    private javax.swing.JPasswordField jPasswordFieldConfirmPassword;
    private javax.swing.JPasswordField jPasswordFieldNewPassword;
    private javax.swing.JPasswordField jPasswordFieldOldPassword;
    private javax.swing.JPasswordField jPasswordFieldPassword;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPaneInfoContent;
    private javax.swing.JSpinner jSpinnerAddCampaignActualBudget;
    private javax.swing.JSpinner jSpinnerAddCampaignActualSales;
    private javax.swing.JSpinner jSpinnerAddCampaignEstimatedBudget;
    private javax.swing.JSpinner jSpinnerAddCampaignEstimatedSales;
    private javax.swing.JSpinner jSpinnerAddCampaignPeriod;
    private javax.swing.JSpinner jSpinnerDeleteCampaignActualBudget;
    private javax.swing.JSpinner jSpinnerDeleteCampaignActualSales;
    private javax.swing.JSpinner jSpinnerDeleteCampaignEstimatedBudget;
    private javax.swing.JSpinner jSpinnerDeleteCampaignEstimatedSales;
    private javax.swing.JSpinner jSpinnerDeleteCampaignPeriod;
    private javax.swing.JSpinner jSpinnerUpdateCampaignActualBudget;
    private javax.swing.JSpinner jSpinnerUpdateCampaignActualSales;
    private javax.swing.JSpinner jSpinnerUpdateCampaignEstimatedBudget;
    private javax.swing.JSpinner jSpinnerUpdateCampaignEstimatedSales;
    private javax.swing.JSpinner jSpinnerUpdateCampaignPeriod;
    private javax.swing.JTabbedPane jTabbedPaneOneCampaign;
    private javax.swing.JTabbedPane jTabbedPaneOneProduct;
    private javax.swing.JTable jTableAllCampaigns;
    private javax.swing.JTable jTableAllProducts;
    private javax.swing.JTextArea jTextAreaAddProductComment;
    private javax.swing.JTextArea jTextAreaDeleteProductComment;
    private javax.swing.JTextArea jTextAreaUpdateProductComment;
    private javax.swing.JTextField jTextFieldAddCampaignType;
    private javax.swing.JTextField jTextFieldAddProductProductName;
    private javax.swing.JTextField jTextFieldDeleteCampaignType;
    private javax.swing.JTextField jTextFieldDeleteProductProductName;
    private javax.swing.JTextField jTextFieldUpdateCampaignType;
    private javax.swing.JTextField jTextFieldUpdateProductProductName;
    private javax.swing.JTextField jTextFieldUsername;
    private javax.swing.JToggleButton jToggleButtonCampaigns;
    private javax.swing.JToggleButton jToggleButtonHome;
    private javax.swing.JToggleButton jToggleButtonProducts;
    private javax.swing.JToolBar jToolBar;
    // End of variables declaration//GEN-END:variables

}
